package com.app.couponsharelife.ui.dialog
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.WindowManager
import android.widget.TextView
import com.app.couponsharelife.R
/**
 *Created by xct on 2019/5/5
 *Description:加载中弹窗
 */
class MyProgressDialog(context: Context,val themeResId: Int,var msg:String) : Dialog(context, themeResId) {
    private var tvMessAge:TextView?=null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.dialog_my_progress)
        tvMessAge=findViewById(R.id.myProgress_message)
        tvMessAge!!.text=msg
        initView()
    }
    private fun initView() {
        window!!.setWindowAnimations(themeResId)
        setCanceledOnTouchOutside(true)
        //设置dialog没有边距
        window!!.decorView.setPadding(0, 0, 0, 0)
        val lp = window!!.attributes
        lp.width = WindowManager.LayoutParams.WRAP_CONTENT
        lp.height = WindowManager.LayoutParams.WRAP_CONTENT
        window!!.attributes = lp
    }
}